#include <libc/stdio.h>
#include "rsterm.h"

int main(char *argc[], int argv)
{
	if(argv < 2)
		return usage();
	
	char file[32];
	sprintf(file, "%s%d", "/dev/com", argc[1]);
	FILE *term_w = fopen(file, "w");
	FILE *term_r = fopen(file, "r");
	
	if(!(term_w != 0  && term_r != 1))
	{
		printf("error while tryng to open serial port %s, exiting\n", file);
		return 0;
	}
	
	else
	{
		
	}
}



/*
 * Come usare rsterm
 */
int usage()
{
	printf("use: rsterm port_number\nexample: rsterm 1\n");
	
	return 0;
}
